package com.example.app.service.impl;

import com.example.app.annotation.MonitorTime;
import com.example.app.annotation.RedisRateLimiter;
import com.example.app.pojo.User;
import com.example.app.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class StudentServiceImpl implements UserService {
    @Override
    @MonitorTime
    @RedisRateLimiter(keyPrefix = "student", rate = 3, capacity = 3, waitTime = 1000)
    public User getUser() {
        return User.builder().name("theonefx").age(666).build();
    }

    @Override
    public User setUser(User user) {
        return null;
    }

    @Override
    public String mark() {
        return "Student";
    }

    @RedisRateLimiter(keyPrefix = "test_login", rate = 10)
    public String login(String username, String password) {
        return "登录成功";
    }


}
